package exception_exercise;

import com.sun.corba.se.spi.orbutil.fsm.StateImpl;

public class ThrowDemo1 {
    public static void main(String[] args) {
        Student1 zs=new Student1();
        try{
            zs.setAge1(1000);
            System.out.println("此人年龄为"+zs.getAge1()+"岁。");
        }catch (RuntimeException e1){
            System.out.println("年龄不合法");
        }
    }
}
